package com.odm.communitymanage.ui.mine.MyComplaint

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.odm.communitymanage.R
import com.odm.communitymanage.core.bean.MyComplaintData
import com.odm.communitymanage.widget.PointProcessBar

/**
 * @description: 我的投诉列表 适配器
 * @author: ODM
 * @date: 2020/4/18
 */
class MyComplaintAdapter(data : MutableList<MyComplaintData>)
    :BaseQuickAdapter<MyComplaintData,BaseViewHolder>(R.layout.item_my_complaint , data){

    override fun convert(holder: BaseViewHolder, item: MyComplaintData) {
        holder.setText(R.id.tvSummary_MyComplaint , item.content)
        holder.setText(R.id.tvTime_MyComplaint , item.time)
        //配置节点进度条
        val indexSet:MutableSet<Int> = mutableSetOf()
        var i = 0
        while(i <= item.status){
            indexSet.add(i)
            i++
        }
        holder.getView<PointProcessBar>(R.id.pb_MyComplaint).show(arrayListOf(
            context.getString(R.string.suspending),
            context.getString(R.string.processing),
            context.getString(R.string.processed)
            ) ,
            indexSet)
    }
}